#!/bin/bash
rm -f test_cpu
for ((i=1;i<5;i=i*2))
do
echo -n "${i}线程   " >> test_cpu
sysbench  --test=cpu --max-requests=10000 --num-threads=$i run > tmp.log
echo  `cat tmp.log  |grep "total time:" |awk '{print $1 $2  $3}'` >> test_cpu
done
rm -rf tmp.log
